<?php echo $this->render('header.phtml'); ?>
<div class="tools">
    <a title="Return" href="<?php echo $this->baseUrl ?>/user"><img alt="Return" src="/public/icons/return.png"/> Return</a>
    <a title="Save changes" href="javascript:document.getElementById('links').submit()"><img alt="Save" src="/public/icons/page_save.png"/> Update</a>
</div>
<script type="text/javascript" src="/public/scripts/func.js"></script>
<form method="post" action="/user/rights" id="links">
<input type="hidden" name="id" value="<?php echo $this->f_user->id;?>"/>
<table class="data" id="mytable" cellspacing="0">
    <th scope="col" width="20" class="first" align="center"><a title="Select/unselect all" href="javascript:check_all_checkboxes('authorities[]');"><B>&nbsp;X</B></a></th>
    <th scope="col">Authority</th>
</tr>
<?php $k=-1;
foreach($this->authorities as $obj) : 
$k++; 
if($k%2==0)
{
    $class='';
    $first_class=' class="first" ';
}else{
    $class=' class="alt" ';
    $first_class=' class="alt first" ';
}?>
<tr>
    <td <?php echo $first_class;?>>
        <input type="checkbox" name="authorities[]" class="check"
        <?php if(in_array($obj->id,$this->links)) echo ' checked '; ?>
        value="<?php echo $obj->id;?>">
    </td>
    <td <?php echo $class;?>><?php echo $this->escape($obj->title);?></td>
</tr>
<?php endforeach; ?>
</table>
</form>
<?php echo $this->render('footer.phtml'); ?>
